package com.cloud.stream2;


import com.cloud.stream2.model.Student;
import com.cloud.stream2.sender.SendService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * @author shengtao
 * @Description:
 * @date 2019/06/03 21:05
 */
@SpringBootApplication
public class StreamKafkaDemo3Application implements CommandLineRunner {

    @Resource
    private SendService sendService;

    public static void main(String[] args){
        SpringApplication.run(StreamKafkaDemo3Application.class,args);
    }

    @Override
    public void run(String... args) throws Exception {
        for (int i = 0;i<1000;i++){
            Student student = new Student(i+"","lishengtao"+i,"class"+i);
            sendService.sendMsg(student);
        }
    }
}
